package com.flame.file.config;

import java.util.List;

import javax.annotation.PostConstruct;

import com.flame.auth.core.config.AuthConfigurationProperties;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * @author wuxintong
 * @since 2022/12/15
 */
@EnableConfigurationProperties(FileConfigurationProperties.class)
@MapperScan("com.flame.file.mapper")
@ComponentScan("com.flame.file")
@Configuration
public class FileConfiguration {

    @Autowired
    private AuthConfigurationProperties authProperties;

    @PostConstruct
    public void init() {
        List<String> whiteList = authProperties.getWhiteList();
        whiteList.add("/static/file");
    }
}
